HEADER GOES HERE

Make An Account
<?php
include('settings.php');



if( $_SERVER['REQUEST_METHOD']=="POST")
{
	$con = mysql_connect(localhost,$sqluser,$sqlpass);
	@mysql_select_db($sqldbase) or die( "Unable to select database");
	$given_username=mysql_real_escape_string($_POST['username']);
	$passhash = md5($_POST['password']);
	$query = "select * from users where handle='$given_username';";
	$response = mysql_query($query,$con);
	mysql_close($con);
	if(mysql_numrows($response)>=1){
		echo("This username is Taken");
	
	}
	else
	{
		require_once('recaptchalib.php');
		$resp = recaptcha_check_answer ($privatekey,
			$_SERVER["REMOTE_ADDR"],
			$_POST["recaptcha_challenge_field"],
			$_POST["recaptcha_response_field"]);

	  if (!$resp->is_valid) {
		// What happens when the CAPTCHA was entered incorrectly
		die ("The reCAPTCHA wasn't entered correctly. Go back and try it again." .
			 "(reCAPTCHA said: " . $resp->error . ")");
	  } 
	  else 
	  {
			$passhash = md5($_POST["password"]);
			$nerfed_email = mysql_real_escape_string($_POST['email']);
			$query = "INSERT INTO users (handle, email, passhash) VALUES( '$given_username', '$nerfed_email', '$passhash')";
			$con = mysql_connect(localhost,$sqluser,$sqlpass);
			@mysql_select_db($sqldbase) or die( "Unable to select database");
			$response = mysql_query($query,$con);
			$query = "select * from users where handle='$given_username' and passhash='$passhash';";
			$response = mysql_query($query,$con);
			mysql_close($con);
			if(mysql_numrows($response)==1)
			{
				$_SESSION['userid']=mysql_result($response,0,"userid");
				$_SESSION['username']=mysql_result($response,0,"handle");
				$_SESSION['auth_token']=md5($passhash.date("m/d/y"));
			}
			Echo("Account Made");
		}
		
		
		
	  
	
	}
}

?>


<form method="post" name="makeuser">
<table>
<tr>
<td>Username:</td><td><input type="text" name="username"></input></td>
</tr>
<tr>
<td>Password:</td><td><input type="password" name="password"></input></td>
</tr>
<tr>
<td>Email:</td><td><input type="text" name="email"></input></td>
</tr>
<tr>
<td>
		<?php
          require_once('recaptchalib.php');
          echo recaptcha_get_html($publickey);
        ?>
</td>
</tr>
<tr><td>
<input type="submit" value="Create!"></input></td>
</tr>
</table>
</form>







FOOTER GOES HERE
